const request = class{
	constructor(url,arg) {
	    this.url=url
			this.arg=arg
	}
	// post
	modepost(){
		return new Promise((resolve,reject)=>{
			uni.request({
				url:this.url,
				method:'POST',
				data:this.arg,
			})
			.then(res=>{
				resolve(res[1].data)
			})
			.catch(err=>{
				reject('出错了')
			})
		})
	}
	//get
	modeget(){
			return new Promise((resolve,reject)=>{
				uni.request({
					url:this.url,
					method:'GET',
					
				})
				.then(res=>{
					resolve(res[1].data)
				})
				.catch(err=>{
					reject('出错了')
			})
		})
	}
}
export default request